chore(bedrock): update default model to Claude Sonnet 4.6#2131
chore(bedrock): update default model to Claude Sonnet 4.6#2131minorun365 wants to merge 1 commit intostrands-agents:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0922c0e to
a38be2c
Compare
|
@poshinchen |
|
Hi @minorun365 could you update the PR to resolve the conflict? then I can approve and merge! |
BREAKING CHANGE: The default Bedrock model has been updated from `us.anthropic.claude-sonnet-4-20250514-v1:0` (Claude Sonnet 4) to `global.anthropic.claude-sonnet-4-6` (Claude Sonnet 4.6). Claude Sonnet 4 was deprecated on April 14, 2026 and will be retired on June 15, 2026 per Anthropic's model deprecations page. This change also switches from region-specific inference profiles (us./eu./apac.) to the global cross-region inference profile (global.), aligning with the TypeScript SDK implementation. The global profile is available in all Bedrock regions and eliminates the need for region-to-prefix mapping logic. Users who have not enabled Claude Sonnet 4.6 in their Bedrock model access settings will need to do so, or explicitly pass a model_id. Closes strands-agents#2130
a38be2c to
0869d67
Compare
|
@poshinchen Rebased onto latest Conflict resolution summary:
All bedrock unit tests pass locally ( |
|
Oh wait I thought that it was another PR... So, due to security reason, we would like to set the default region to I think the minimum change would be to just update the model_id. |
|
@poshinchen thanks for the clarification — I now understand the security-driven preference for keeping Why simply updating to
|
| prefix | Sonnet 4 (current default) | Sonnet 4.6 |
|---|---|---|
us.* |
✅ | ✅ (us-east/west + ca) |
eu.* |
✅ | ✅ |
apac.* |
✅ | ❌ removed |
au.* |
❌ | ✅ (only ap-southeast-2/4/6) |
global.* |
❌ | ✅ (all commercial regions) |
The current _get_default_model_with_warning relies on the apac.* prefix existing. With 4.6, APAC regions outside Australia/NZ (Tokyo, Seoul, Singapore, Mumbai, etc.) have no geo profile at all — only global.*. So keeping us. as the hard-coded default means any user in those regions gets a cross-geography routing error before IAM is even evaluated.
Options I see
us.anthropic.claude-sonnet-4-6+ keep the validation logic
Simplest code diff but silently breaks for Tokyo/Seoul/Singapore/Mumbai/etc. users — they'd need to explicitly set amodel_idjust to get the SDK to work. Not ideal for a "sensible default."- Downgrade default to Sonnet 4.5 (
us.anthropic.claude-sonnet-4-5-20250929-v1:0)
Sonnet 4.5 still hasapac.*, so the existing region-to-prefix mapping keeps working unchanged. This buys time but pushes the problem one model generation out — Sonnet 4.7 is likely to follow 4.6's pattern (noapac.*), so we'd revisit this the next time the default gets bumped. global.anthropic.claude-sonnet-4-6(this PR)
Works from every Bedrock commercial region out of the box, aligns with what the TypeScript SDK already defaults to, and removes the mapping logic becauseglobal.*needs none. The security concern is real but it applies to the default value; users who must stay within a specific geography can explicitly setmodel_id="us.anthropic.claude-sonnet-4-6"(or pin via env var as today). We could keep a warning that encourages explicit pinning in compliance-sensitive environments.
If the security posture requires staying with us. for the default, option 2 (Sonnet 4.5) looks like the only path that keeps the SDK usable everywhere without breaking APAC users. Option 3 is my preference because it matches the TS SDK and future-proofs against further APAC profile churn, but I understand if the security argument outweighs that.
Happy to update the PR to whichever direction you prefer. What's your read?
Motivation
Claude Sonnet 4 (
claude-sonnet-4-20250514) was deprecated on April 14, 2026 and will be retired on June 15, 2026 per Anthropic's model deprecations page. SinceDEFAULT_BEDROCK_MODEL_IDis the model used when no explicitmodel_idis passed, this is a critical update — agents using the default will stop working after the retirement date.This change also switches from region-specific inference profiles (
us./eu./apac.) to theglobal.cross-region inference profile, aligning with the TypeScript SDK which already usesglobal.anthropic.claude-sonnet-4-6. This simplification aligns with two of our Development Tenets:_get_default_model_with_warning) was necessary whenapac.profiles existed, but Claude Sonnet 4.6 no longer offers anapac.profile (APAC regions have been split intojp.andau., with other APAC regions only supportingglobal.). Theglobal.profile works across all Bedrock regions, making the mapping logic unnecessary.global.as the default. Using the same approach ensures consistency across SDKs and reduces cognitive overhead for developers working with both.Resolves: #2130
Public API Changes
DEFAULT_BEDROCK_MODEL_IDchanges fromus.anthropic.claude-sonnet-4-20250514-v1:0toglobal.anthropic.claude-sonnet-4-6:The internal
_DEFAULT_BEDROCK_MODEL_IDtemplate and_get_default_model_with_warning()static method have been removed as they are no longer needed with theglobal.profile.Breaking Changes
Users must enable Claude Sonnet 4.6 model access in their AWS Bedrock console. The
global.anthropic.claude-sonnet-4-6cross-region inference profile must be accessible from the user's configured region.Migration
Users relying on the previous default need no code changes — only Bedrock model access enablement. Users who want to continue using Sonnet 4 (until retirement) can explicitly pass the model ID:
Related Issues
#2130
Type of Change
Breaking change
Testing
hatch test— 235 passed)hatch fmt --formatter,hatch fmt --linter)global.anthropic.claude-sonnet-4-6fromus-east-1andap-northeast-1Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.